<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>数据绑定</title>
    <script src="angularjs/angular.min.js"></script>
</head>
<!--在body范围内被angular解析-->
<body ng-app="doraApp">
    <div ng-controller="testCtrl">
        <h3>{{name}}</h3>
        <h3>{{site}}</h3>
    </div>

    <hr/>
    <div>{{name}}</div>

    <hr/>
    <div ng-controller="test2Ctrl">
        <h3>{{name}}</h3>
    </div>
<script>
    var doraApp = angular.module("doraApp",[]);

    doraApp.controller("testCtrl",function($scope){
        $scope.name = "doramart";
        $scope.site = "doramart.com";
    });

    doraApp.controller("test2Ctrl",function($scope){
        $scope.name = "giess";
    });
</script>
</body>
</html>